<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<!-- <script src="js/jquery-1.11.3.js" type="text/javascript" charset="utf-8"></script> -->
<script type="text/javascript" src="js/jquery-1.11.3.js" charset="utf-8"></script>

	<script type="text/javascript">
		function ajaxGet(){
			$.get(
					"/JavaWeb190703/ajax",
				{"name" : "张三","age" : 23},
				function(data){
					alert("name:" + data.name + ",age" + data.age);
				},
				"json"
			);
		}
		
		function ajaxPost(){
			// $.get(url, [data], [callback], [type])
			$.post(
					"/JavaWeb190703/ajax",
				{"name" : "李四","age" : 24},
				function(data){
					alert("name:" + data.name + ",age" + data.age);
				},
				"json"
			);
		}
		
		function ajax(){
			// $.ajax( { option1:value1,option2:value2... } ); 
			$.ajax({
				url:"/JavaWeb190703/ajax",
				data:{"name":"张三","age":23},
				type:"post",
				dataType:"json",
				success:function(jsonObj){
					alert("name:" + jsonObj.name + ",age:" + jsonObj.age);
				}
			});
		}
	</script>
</head>
<body>
	<button onclick="ajaxGet()">ajaxGet</button>
	<button onclick="ajaxPost()">ajaxPost</button>
	<button onclick="ajax()">ajax</button>
</body>
</html>